home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
-
- proc setOptionVars (int $forceFactorySettings)
- {
- if ($forceFactorySettings || !`optionVar -exists polyCurrentUVSet`)
- optionVar -stringValue polyCurrentUVSet "";
- }
-
- global proc performSetCurrentUVSetSetup (string $parent,
- int $forceFactorySettings)
- {
- setOptionVars($forceFactorySettings);
- setParent $parent;
-
- string $sval;
- $sval = `optionVar -query polyCurrentUVSet`;
- textFieldGrp -edit -tx $sval polyCurrentUVSet;
- }
-
- global proc performSetCurrentUVSetCallback (string $parent, int $doIt)
- {
- setParent $parent;
-
- optionVar -stringValue polyCurrentUVSet
- `textFieldGrp -query -tx polyCurrentUVSet`;
-
- if ($doIt) {
- performSetCurrentUVSet 0;
- addToRecentCommandQueue "performSetCurrentUVSet 0" "SetCurrentUVSet";
- }
- }
-
- proc polySetCurrentUVSetOptions()
- {
- string $commandName = "performSetCurrentUVSet";
- string $callback = ($commandName + "Callback");
- string $setup = ($commandName + "Setup");
-
- string $layout = getOptionBox();
- setParent $layout;
- setUITemplate -pushTemplate DefaultTemplate;
- waitCursor -state 1;
-
- string $parent = `columnLayout -adjustableColumn true`;
-
- textFieldGrp -label "UV Set Name: " polyCurrentUVSet;
-
- setParent $parent;
-
- waitCursor -state 0;
- setUITemplate -popTemplate;
-
- string $applyBtn = getOptionBoxApplyBtn();
- button -edit -label "Set Current"
- -command ($callback + " " + $parent + " " + 1)
- $applyBtn;
-
- string $saveBtn = getOptionBoxSaveBtn();
- button -edit
- -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox")
- $saveBtn;
-
- string $resetBtn = getOptionBoxResetBtn();
- button -edit
- -command ($setup + " " + $parent + " " + 1)
- $resetBtn;
-
- setOptionBoxTitle("Set Current UV Set Options");
-
- setOptionBoxHelpTag( "SetCurrentUVSet" );
-
- eval (($setup + " " + $parent + " " + 0));
- showOptionBox();
- }
-
- global proc string performSetCurrentUVSet (int $option)
- {
- string $cmd="polyUVSet -currentUVSet -uvSet ";
- switch ($option)
- {
-
- case 1: polySetCurrentUVSetOptions;
- // Just the option box
- break;
-
- default:
- setOptionVars(false);
- string $name = `optionVar -query polyCurrentUVSet`;
-
- if (size($name))
- {
- $cmd += ("\"" + $name + "\"");
- if ($option == 0)
- evalEcho $cmd;
- }
- else
- {
- if ($option == 0)
- warning "No name specified to set current uvset to.";
- }
- break;
- }
- return $cmd;
- }
-
-
-